﻿@model KnowledgeCommunity.Model.UserAccount

@{
    ViewBag.Title = "编辑";
    Layout = "~/Views/Shared/_Layout_zone.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>


<div class="contentcontainer">
    <div class="headings">
        <h2>编辑</h2>
    </div>
    <div class="contentbox">
        @using (Html.BeginForm("Edit", "Account", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
            @Html.ValidationSummary(true)
            @Html.HiddenFor(model => model.Id)
            @Html.HiddenFor(model=>model.AddTime)
            @Html.HiddenFor(model => model.UserName)

            <table>
                <tr>
                    <th width="120px">&nbsp; 用户名</th>
                    <td>
                      @Model.UserName
                    </td>
                </tr>
                <tr>
                   <th>用户角色</th>
                   <td>
                   @{
                 List<SelectListItem> selectList = new List<SelectListItem>();
                 selectList.Add(new SelectListItem { Text = "--请用户角色--", Value = "0", Selected = true });
                 foreach (object e in Enum.GetValues(typeof(KnowledgeCommunity.Service.Enum.UserRole)))
                 {
                     selectList.Add(new SelectListItem
                     {
                         Text = Enum.GetName(typeof(KnowledgeCommunity.Service.Enum.UserRole), e),
                         Value = ((int)e).ToString()
                     });
                 }
                        @Html.DropDownList("urole", selectList);
                    } 
                   </td>
                </tr>
                <tr>
                   <th>用户状态</th>
                   <td>
                    @{
                                                               List<SelectListItem> stateList = new List<SelectListItem>();
                                                               foreach (object e in Enum.GetValues(typeof(KnowledgeCommunity.Service.Enum.UserState)))
                                                               {
                                                                   stateList.Add(new SelectListItem
                                                                   {
                                                                       Text = Enum.GetName(typeof(KnowledgeCommunity.Service.Enum.UserState), e),
                                                                       Value = ((int)e).ToString()
                                                                   });
                                                               }
                        @Html.DropDownList("ustate", stateList);
                    }
                   </td>
                </tr>
                <tr>
                   <th></th>
                   <td>
                    <input type="button" title="取消" value="<< 返回" id="GoBackList" onclick="history.go(-1)" />
                    <input class="btn" id="save" title="保存" value="确定 >>" type="submit" />
                   </td>
                </tr>
            </table>
         }  
        <div style="clear: both;"></div>
    </div>
</div>



